package com.jackson.engineeringtechnologyguide.conditional.condition;

/*
 * Author: JacksonCoder
 * FileName: RandBooleaCondition
 * Version: 1.0.0
 * Date: 2025/1/11
 */

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * 布尔随机数条件检验
 */

public class RandBooleanCondition implements Condition {


    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        String type = context.getEnvironment().getProperty("conditional.rand.type");
        return "boolean".equals(type);
    }
}
